home *** CD-ROM | disk | FTP | other *** search
/ Safarir 3 / SafTV-CD3.iso / pc / Bonus / Dessins Animés / static / jeux / bowling.swf / scripts / frame_36 / DoAction.as
Text File  |  2002-03-17  |  6KB  |  344 lines

  1. stop();
  2. koniec = "0";
  3. if(wynik == "0")
  4. {
  5.    ile = "0";
  6.    ile_ = ile;
  7.    if(strona == "1")
  8.    {
  9.       kula = "7";
  10.    }
  11.    else
  12.    {
  13.       kula = "1";
  14.    }
  15.    kula1 = kula;
  16.    trace(kula1 add " kula1");
  17.    tellTarget("rzut" add kula)
  18.    {
  19.       gotoAndPlay(2);
  20.    }
  21.    while(koniec == "1")
  22.    {
  23.    }
  24. }
  25. else if(rzut == "1")
  26. {
  27.    strona_ = strona;
  28.    if(wynik == "0" or wynik == "10")
  29.    {
  30.       ile = wynik;
  31.    }
  32.    else
  33.    {
  34.       ile = int(wynik) + random("2");
  35.    }
  36.    ile_ = ile;
  37.    if(strona == "1")
  38.    {
  39.       l = "10";
  40.       p = "11" - ile;
  41.       l1 = p - "1";
  42.       p1 = "1";
  43.    }
  44.    else
  45.    {
  46.       l = ile;
  47.       p = "1";
  48.       l1 = "10";
  49.       p1 = l + "1";
  50.    }
  51.    if(strona != "1")
  52.    {
  53.       if(ile == "1" or ile == "2" or ile == "3")
  54.       {
  55.          kula = "2";
  56.       }
  57.       if(ile == "4" or ile == "5" or ile == "6")
  58.       {
  59.          kula = "3";
  60.       }
  61.       if(ile == "7" or ile == "8" or ile == "9" or ile == "10")
  62.       {
  63.          kula = "4";
  64.       }
  65.    }
  66.    if(strona == "1")
  67.    {
  68.       if(ile == "1" or ile == "2" or ile == "3")
  69.       {
  70.          kula = "6";
  71.       }
  72.       if(ile == "4" or ile == "5" or ile == "6" or ile == "7")
  73.       {
  74.          kula = "5";
  75.       }
  76.       if(ile == "8" or ile == "9" or ile == "10")
  77.       {
  78.          kula = "4";
  79.       }
  80.    }
  81.    kula1 = kula;
  82.    trace("kula1" add kula1);
  83.    trace("strona" add strona);
  84.    tellTarget("rzut" add kula)
  85.    {
  86.       gotoAndPlay(2);
  87.    }
  88.    if(ile == "10")
  89.    {
  90.       tellTarget("/str")
  91.       {
  92.          gotoAndPlay(2);
  93.       }
  94.       tellTarget("/plansza")
  95.       {
  96.          gotoAndPlay(2);
  97.       }
  98.       tellTarget("/james")
  99.       {
  100.          gotoAndPlay(2);
  101.       }
  102.    }
  103.    i = l;
  104.    while(i >= p)
  105.    {
  106.       trace("K" add i add ":z");
  107.       tellTarget("K" add i)
  108.       {
  109.          gotoAndStop("z");
  110.          play();
  111.       }
  112.       set("K" add i,"0");
  113.       i -= "1";
  114.    }
  115. }
  116. else
  117. {
  118.    if(ile_ == "9")
  119.    {
  120.       if(wynik == "10")
  121.       {
  122.          ile = "1";
  123.       }
  124.       else
  125.       {
  126.          ile = "0";
  127.       }
  128.    }
  129.    else
  130.    {
  131.       ile = int(int(wynik) / "10" * ("10" - ile));
  132.    }
  133.    if(strona == "1")
  134.    {
  135.       l = l1;
  136.       p = l1 + "1" - ile;
  137.    }
  138.    else
  139.    {
  140.       l = p1 + ile - "1";
  141.       p = p1;
  142.    }
  143.    trace(l add " - l1");
  144.    trace(p add " - p1");
  145.    trace(ile add " - ile");
  146.    i = l;
  147.    if(strona != "1")
  148.    {
  149.       if(kula1 == "1" or kula1 == "7")
  150.       {
  151.          if(ile == "1" or ile == "2" or ile == "3")
  152.          {
  153.             kula = "2";
  154.          }
  155.          if(ile == "4" or ile == "5" or ile == "6")
  156.          {
  157.             kula = "3";
  158.          }
  159.          if(ile == "7" or ile == "8" or ile == "9" or ile == "10")
  160.          {
  161.             kula = "4";
  162.          }
  163.       }
  164.       if(kula1 == "2")
  165.       {
  166.          if(ile == "10")
  167.          {
  168.             kula = "4";
  169.          }
  170.          else
  171.          {
  172.             kula = "3";
  173.          }
  174.       }
  175.       if(kula1 == "3")
  176.       {
  177.          kula = "4";
  178.       }
  179.       if(kula1 == "4")
  180.       {
  181.          if(strona_ == "1")
  182.          {
  183.             kula = "2";
  184.          }
  185.          else
  186.          {
  187.             kula = "5";
  188.          }
  189.       }
  190.       if(kula1 == "5")
  191.       {
  192.          kula = "2";
  193.       }
  194.       if(kula1 == "6")
  195.       {
  196.          if("2" < ile)
  197.          {
  198.             kula = "3";
  199.          }
  200.          else
  201.          {
  202.             kula = "2";
  203.          }
  204.       }
  205.    }
  206.    else
  207.    {
  208.       if(kula1 == "1" or kula1 == "7")
  209.       {
  210.          if(ile == "1" or ile == "2" or ile == "3")
  211.          {
  212.             kula = "6";
  213.          }
  214.          if(ile == "4" or ile == "5" or ile == "6" or ile == "7")
  215.          {
  216.             kula = "5";
  217.          }
  218.          if(ile == "8" or ile == "9" or ile == "10")
  219.          {
  220.             kula = "4";
  221.          }
  222.       }
  223.       if(kula1 == "2")
  224.       {
  225.          if("2" < ile)
  226.          {
  227.             kula = "5";
  228.          }
  229.          else
  230.          {
  231.             kula = "6";
  232.          }
  233.       }
  234.       if(kula1 == "3")
  235.       {
  236.          if("2" < ile)
  237.          {
  238.             kula = "5";
  239.          }
  240.          else
  241.          {
  242.             kula = "6";
  243.          }
  244.       }
  245.       if(kula1 == "4")
  246.       {
  247.          if(strona_ == "1")
  248.          {
  249.             kula = "3";
  250.          }
  251.          else
  252.          {
  253.             kula = "5";
  254.          }
  255.       }
  256.       if(kula1 == "5")
  257.       {
  258.          if("2" < ile)
  259.          {
  260.             kula = "3";
  261.          }
  262.          else
  263.          {
  264.             kula = "4";
  265.          }
  266.       }
  267.       if(kula1 == "6")
  268.       {
  269.          if("3" < ile)
  270.          {
  271.             kula = "4";
  272.          }
  273.          else
  274.          {
  275.             kula = "5";
  276.          }
  277.       }
  278.    }
  279.    if(ile_ == "9" and ile == "0")
  280.    {
  281.       kula = "4";
  282.    }
  283.    if(ile_ == "8" and ile == "0")
  284.    {
  285.       kula = "4";
  286.    }
  287.    trace("kula" add kula1);
  288.    tellTarget("rzut" add kula)
  289.    {
  290.       gotoAndPlay(2);
  291.    }
  292.    if(ile_ == "0" or ile_ == "10")
  293.    {
  294.       if(strona == "1")
  295.       {
  296.          l = "10";
  297.          p = "11" - ile;
  298.       }
  299.       else
  300.       {
  301.          l = ile;
  302.          p = "1";
  303.       }
  304.    }
  305.    if(ile == "0")
  306.    {
  307.       stopAllSounds();
  308.    }
  309.    if(ile_ + ile == "10")
  310.    {
  311.       tellTarget("/spa")
  312.       {
  313.          gotoAndPlay(2);
  314.       }
  315.       tellTarget("/plansza")
  316.       {
  317.          gotoAndPlay(2);
  318.       }
  319.       tellTarget("/james")
  320.       {
  321.          gotoAndPlay(2);
  322.       }
  323.    }
  324.    i = l;
  325.    while(i >= p)
  326.    {
  327.       trace("K" add i add ":z");
  328.       tellTarget("K" add i)
  329.       {
  330.          gotoAndStop("z");
  331.          play();
  332.       }
  333.       set("K" add i,"0");
  334.       i -= "1";
  335.    }
  336. }
  337. if(ile == "0")
  338. {
  339.    tellTarget("/mis")
  340.    {
  341.       gotoAndPlay(2);
  342.    }
  343. }
  344.